package com.jiyun.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.mapper.CarorderMapper;
import com.jiyun.pojo.Carorder;
import com.jiyun.service.CarorderService;
import com.jiyun.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarorderServiceImpl extends ServiceImpl<CarorderMapper, Carorder> implements CarorderService {

    @Autowired
    private CarorderMapper carorderMapper;

    @Override
    public R findCarOrderAll() {
        List<Carorder> list = carorderMapper.selectList(null);
        return R.ok().data("list",list);
    }

    @Override
    public R findCarOrderById(Integer id) {
        Carorder carorder = carorderMapper.selectById(id);
        return R.ok().data("maintorder",carorder);
    }
}
